package com.ysd.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ysd.entity.Cart;
import com.ysd.service.CartShuLiangService;
import com.ysd.util.Result;

@Controller
public class CartShuLiangController {

	
	
	@Autowired
	private CartShuLiangService cartShuLiangService;
	
	
	@RequestMapping("insertCart")
	@ResponseBody
	public String insertCart(Cart cart) {
	int	n=cartShuLiangService.findInsertCart(cart);
		
	if(n>0) {
		return Result.toClient("0", "添加成功", null);
	} else {
		return Result.toClient("1", "添加失败", null);
	}
		
		
	}
}
